<template>
  <div id="center">
    <div id="centerleft" class="centerleft">
      <dv-scroll-board :config="config" />
    </div>

    <dv-border-box-10 class="centerright">
      <div id="centerright" class="centerright">
      </div>
    </dv-border-box-10>
  </div>
</template>

<script>
export default {
  name: 'Center',
  data() {
    return {
      config: {
        header: ['时间', '病害信息', '数量', '标段'],
        data: [
          ['2019-07-01 19:25:00', '路面危害-松散', '5', 'xxxxxxx'],
          ['2019-07-02 17:25:00', '路面危害-路面油污清理', '13', 'xxxxxxx'],
          ['2019-07-03 16:25:00', '交安设施-交通标志牌结构', '6', 'xxxxxxx'],
          ['2019-07-04 15:25:00', '路基危害-防尘网', '2', 'xxxxxxx'],
          ['2019-07-05 14:25:00', '交安设施-交通标志牌结构', '1', 'xxxxxxx'],
          ['2019-07-06 13:25:00', '路面危害-松散', '3', 'xxxxxxx'],
          ['2019-07-07 12:25:00', '路基危害-防尘网', '4', 'xxxxxxx'],
          ['2019-07-08 11:25:00', '路面危害-路面油污清理', '2', 'xxxxxxx'],
          ['2019-07-09 10:25:00', '交安设施-交通标志牌结构', '5', 'xxxxxxx'],
          ['2019-07-10 09:25:00', '路基危害-防尘网', '3', 'xxxxxxx']
        ],
        index: true,
        columnWidth: [50, 170, 300],
        align: ['center'],
        rowNum: 7,
        headerBGC: '#1981f6',
        headerHeight: 45,
        oddRowBGC: 'rgba(0, 44, 81, 0.8)',
        evenRowBGC: 'rgba(10, 29, 50, 0.8)'
      }
    }
    },
  methods: {
    drawChart() {
      // 基于准备好的dom，初始化echarts实例
      let myChart4 = this.$echarts.init(document.getElementById('centerright'));

      // 指定图表的配置项和数据
      let option4 = {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [{
          data: [120, 200, 150, 80, 70, 110, 130],
          type: 'bar'
        }],
        // grid: {
        //      width :'auto'
        // },
      };
      myChart4.setOption(option4);

    },
  },
  mounted() {
    this.drawChart();
  }
}

</script>

<style scoped>
#center {
  width: 100%;
  height: 300px;
  display: flex;
  justify-content: left;
}
#centerleft {
  width: 50%;
  height: 300px;
  box-sizing: border-box;
  overflow: hidden;
}
/* .centerleft {
  width: 600px;
  height: 400px;
} */

.centerright {
  width: 50%;
  height: 300px;
}
</style>